home *** CD-ROM | disk | FTP | other *** search
- /*
- CreatePlanet.rx V0.9ss
- Creates a Planet for PfPaint Arexx Box
- By Markus Castro
- */
-
- Options results
- parse ARG Port x1 y1 x2 y2 b
- ADDRESS value Port
-
- Mesh=6
- hour=12
- tilt=1
- Path='PerfectPaint:tools/'
-
- IF exists('PerfectPaint:Prefs/Rexx_Prefs/Create_Planet') THEN DO
- IF OPEN('lfile','PerfectPaint:Prefs/Rexx_Prefs/Create_Planet', "R") then DO
- Mesh = READLN('lfile')
- Hour=READLN('lfile')
- Tilt=READLN('lfile')
- Path=READLN('lfile')
- CALL CLOSE('lfile')
- END
- END
-
- IF Path="" then DO
- Path='PerfectPaint:tools/'
- END
-
- address value port
- pp_AvoidRefresh
- width=(x2-x1)+1
- height=(y2-y1)+1
- mx=x1+(width/2)
- my=y1+(height/2)
- pp_GetCurrentBrush
- Alt=result
-
- pp_DialogInit 220 140 "*Create*Planet*" 5
- pp_Slider 0 65 8 100 16 "Quality" 0 0 5 Mesh
- pp_Slider 1 65 26 100 16 "Hour" 0 0 24 hour
- pp_Slider 2 65 44 100 16 "°*Tilt" 0 0 90 tilt
- pp_String 3 8 85 177 16 "PPMforge*Path" 4 100 Path
- pp_Getfile 4 188 86 3 "Select*Path" 1 Path
- pp_Dialog
-
- rc=result
- IF rc=0 then DO
- pp_permitrefresh
- EXIT
- END
-
- pp_GetDialog 0
- Mesh=result
- Mesh2=16*(2**mesh)
-
- pp_GetDialog 1
- Hour=result
-
- pp_GetDialog 2
- Tilt=result
-
- pp_GetDialog 3
- Path=result
-
- pp_asay 'Making*PNM*Planet|Please*wait*...'
- ADDRESS COMMAND path||"ppmforge -hour " || hour || " -tilt " || tilt || " -mesh " || Mesh2 || "x" || mesh2 || " -width " || width || " -height " || height || " >t:PfPaint.Planet"
- pp_closeasay
- pp_FindEmptyBrush
- Brush=result
- IF Brush=-1 then DO
- pp_Warn "can't*find*empty|Brush."
- EXIT
- END
-
- pp_setbrush brush
- pp_Bload 't:PfPaint.Planet'
- pp_UpdateUndoBox x1-1 y1-1 x2+1 y2+1
- pp_Plot mx my
- pp_freebrush
- pp_SetBrush alt
-
- SavePrefs('Create_Planet',Mesh,Hour,Tilt,Path)
- ADDRESS COMMAND "delete t:PfPaint.Planet"
- pp_permitrefresh
-
- EXIT
-
- SavePrefs: PROCEDURE
- Prefname='PerfectPaint:Prefs/Rexx_Prefs/'||ARG(1)
- IF EXISTS(Prefname) THEN DO
- ADDRESS COMMAND
- 'delete >nil: '||Prefname
- END
-
- IF OPEN('pfile',PrefName,'W') THEN DO
- DO i=2 to ARG()
- CALL WRITELN('pfile',ARG(i))
- END
- CALL CLOSE('pfile')
- RETURN 0
-